package com.pocket.demo.base.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 【demo-springdoc-3】
 * <a href="https://springdoc.org/#spring-webmvc-support">springdoc docs</a>
 * <a href="http://localhost:8888/swagger-ui/index.html">swagger-ui访问地址</a>
 * @author zhaozhile
 */
@Configuration
public class SpringDocConfig {

    @Bean
    public OpenAPI springShopOpenApi() {
        return new OpenAPI()
                .info(new Info()
                        .title("Cases Pocket Apis.")
                        .description("Cases sample application.")
                        .version("v1.0")
                        .license(new License().name("MIT").url("https://opensource.org/licenses/MIT")))
                .externalDocs(new ExternalDocumentation()
                        .description("Redis Pocket Wiki Documentation")
                        .url("https://springdoc.org/#migrating-from-springfox"))
                ;
    }

}
